function [matrix] = drawNodes(noOfNodes,netXloc, netYloc, R, r, g, b)
    for i = 1:noOfNodes       
        plot(netXloc(i), netYloc(i), '.');        
        text(netXloc(i), netYloc(i), num2str(i));
        for j = 1:noOfNodes
            dist = distance(netXloc(i),netYloc(i),netXloc(j),netYloc(j));            
            if dist < R
                matrix(i, j) = 1; % there is a link; They are in the same transmission range.
                % To draw line among all the nodes with RGB colors
                %line([netXloc(i) netXloc(j)], [netYloc(i) netYloc(j)], 'LineStyle',':','color',[r,g,b]);

            else
                matrix(i, j) = 0; % there is no link; They are not in the same transmission range.               
            end;
        end;
    end;    
end